#pragma once
#ifndef _SINGLETON_H
#define _SINGLETON_H

#include <assert.h>
#include "Ptr.hpp"

template< class T >
class Singleton
{
protected:
  Singleton () {}
  Singleton (const Singleton&) { assert (false && "Singleton Error"); }
  Singleton& operator= (const Singleton&) { assert (false && "Singleton Error"); }

public:
  static T& getSingleton ()
  {
    static T singleton;
    return singleton;
  }

  static Ptr< T > getSingletonPtr ()
  {
    return &getSingleton ();
  }

};

#endif